<!DOCTYPE html>







































































<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<link rel="shortcut icon" type="image/x-icon" href="../../../../../favicon.ico" />
<title>com.google.android.youtube.player | Android Developers</title>

<!-- STYLESHEETS -->
<link rel="stylesheet"
href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic,bold" title="roboto">
<link href="../../../../../assets/css/default.css" rel="stylesheet" type="text/css">


<!-- FULLSCREEN STYLESHEET -->
<link href="../../../../../assets/css/fullscreen.css" rel="stylesheet" class="fullscreen"
type="text/css">


<!-- JAVASCRIPT -->
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script src="../../../../../assets/js/global-libraries-combined.js" type="text/javascript"></script>
<script type="text/javascript">
  var toRoot = "../../../../../";
</script>
<script src="../../../../../assets/js/docs.js" type="text/javascript"></script>

</head>

<body class="gc-documentation 
  develop">
  <div id="doc-api-level" class="" style="display:none"></div>
  <a name="top"></a>

    <!-- Header -->
          
    
  

  <div class="wrap clearfix" id="body-content">
    <div class="col-4" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
      <div id="devdoc-nav">
      <div id="swapper">
        <div id="nav-panels">
          <div id="classes-nav" class="scroll-pane">



            <ul>
              
    <li><h2>Interfaces</h2>
      <ul>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.html">YouTubePlayer</a></li>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.OnFullscreenListener.html">YouTubePlayer.OnFullscreenListener</a></li>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.OnInitializedListener.html">YouTubePlayer.OnInitializedListener</a></li>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.PlaybackEventListener.html">YouTubePlayer.PlaybackEventListener</a></li>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.PlayerStateChangeListener.html">YouTubePlayer.PlayerStateChangeListener</a></li>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.PlaylistEventListener.html">YouTubePlayer.PlaylistEventListener</a></li>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.Provider.html">YouTubePlayer.Provider</a></li>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubeThumbnailLoader.html">YouTubeThumbnailLoader</a></li>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubeThumbnailLoader.OnThumbnailLoadedListener.html">YouTubeThumbnailLoader.OnThumbnailLoadedListener</a></li>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubeThumbnailView.OnInitializedListener.html">YouTubeThumbnailView.OnInitializedListener</a></li>
      </ul>
    </li>
              
    <li><h2>Classes</h2>
      <ul>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubeApiServiceUtil.html">YouTubeApiServiceUtil</a></li>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubeBaseActivity.html">YouTubeBaseActivity</a></li>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubeIntents.html">YouTubeIntents</a></li>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubePlayerFragment.html">YouTubePlayerFragment</a></li>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubePlayerSupportFragment.html">YouTubePlayerSupportFragment</a></li>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubePlayerView.html">YouTubePlayerView</a></li>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubeStandalonePlayer.html">YouTubeStandalonePlayer</a></li>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubeThumbnailView.html">YouTubeThumbnailView</a></li>
      </ul>
    </li>
              
    <li><h2>Enums</h2>
      <ul>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubeInitializationResult.html">YouTubeInitializationResult</a></li>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.ErrorReason.html">YouTubePlayer.ErrorReason</a></li>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.PlayerStyle.html">YouTubePlayer.PlayerStyle</a></li>
        <li class="api apilevel-"><a href="../../../../../com/google/android/youtube/player/YouTubeThumbnailLoader.ErrorReason.html">YouTubeThumbnailLoader.ErrorReason</a></li>
      </ul>
    </li>
              
              
            </ul><br/>
        

          </div><!-- end classes -->
        </div><!-- end nav-panels -->
        <div id="nav-tree" style="display:none" class="scroll-pane">
          <div id="tree-list"></div>
        </div><!-- end nav-tree -->
      </div><!-- end swapper -->
      <div id="nav-swap">
      <a class="fullscreen">fullscreen</a>
      <a href='#' onclick='swapNav();return false;'><span id='tree-link'>Use Tree Navigation</span><span id='panel-link' style='display:none'>Use Panel Navigation</span></a>
      </div>
    </div> <!-- end devdoc-nav -->
    </div> <!-- end side-nav -->
    <script type="text/javascript">
      // init fullscreen based on user pref
      var fullscreen = readCookie("fullscreen");
      if (fullscreen != 0) {
        if (fullscreen == "false") {
          toggleFullscreen(false);
        } else {
          toggleFullscreen(true);
        }
      }
      // init nav version for mobile
      if (isMobile) {
        swapNav(); // tree view should be used on mobile
        $('#nav-swap').hide();
      } else {
        chooseDefaultNav();
        if ($("#nav-tree").is(':visible')) {
          init_default_navtree("../../../../../");
        }
      }
      // scroll the selected page into view
      $(document).ready(function() {
        scrollIntoView("packages-nav");
        scrollIntoView("classes-nav");
        });
    </script>
    <script>
      $(document).ready(function() {
        changeDocLang(getLangPref());
        });
    </script>



<div class="col-12" id="doc-col">

<div id="api-info-block">
<div class="api-level">
  


  
  

</div>
</div>

<div id="jd-header">
  package
  <h1>com.google.android.youtube.player</h1>
</div><!-- end header -->

<div id="naMessage"></div>

<div id="jd-content" class="api apilevel-">


  <div class="jd-descr">
    <p>This package contains all the interfaces and classes of the YouTube
    Android Player API. This API enables you to easily play YouTube videos and
    display thumbnails of YouTube videos in your Android application.</p>
  <p>There are two ways to play videos. The first option is to place a
    <code><a href="../../../../../com/google/android/youtube/player/YouTubePlayerFragment.html">YouTubePlayerFragment</a></code> or <code><a href="../../../../../com/google/android/youtube/player/YouTubePlayerView.html">YouTubePlayerView</a></code> in your View hierarchy
    and then use the <code><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.html">YouTubePlayer</a></code> to
    control video playback in the View. This gives a fine control of the
    experience. For example, you can decide the size of the video, listen to
    events from the player and control the playback.</p>
  <p>
    The second option is to use the <code><a href="../../../../../com/google/android/youtube/player/YouTubeStandalonePlayer.html">YouTubeStandalonePlayer</a></code> which will start
    video playback in a separate activity. This is simpler to use, however it
    gives you less flexibility and control over video playback. The
    StandalonePlayer supports two modes, either fullscreen or <em>lightbox</em>.
    In lightbox mode, the activity launching the player is still visible behind
    the player, slightly dimmed.
  </p>
  <p>To display YouTube thumbnails, place a <code><a href="../../../../../com/google/android/youtube/player/YouTubeThumbnailView.html">YouTubeThumbnailView</a></code> in your view
    hierarchy and then use the <code><a href="../../../../../com/google/android/youtube/player/YouTubeThumbnailLoader.html">YouTubeThumbnailLoader</a></code> to load a single
    video thumbnail or a whole playlist.
  <p>The API is distributed together with a set of samples that give some
    examples of how to use specific parts, see the 'sample' directory in the
    distributed zip file.</p>

  </div>





  
    <h2>Interfaces</h2>
    <div class="jd-sumtable">
    
  <table class="jd-sumtable-expando">
        <tr class="alt-color api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.html">YouTubePlayer</a></td>
              <td class="jd-descrcol" width="100%">A YouTubePlayer provides methods for loading, playing and controlling YouTube video playback.&nbsp;</td>
          </tr>
        <tr class=" api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.OnFullscreenListener.html">YouTubePlayer.OnFullscreenListener</a></td>
              <td class="jd-descrcol" width="100%">Interface definition for callbacks which are invoked when the player toggles between fullscreen
 on or off, either due to the user clicking the fullscreen button or a call to
 <code><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.html#setFullscreen(boolean)">setFullscreen(boolean)</a></code>.&nbsp;</td>
          </tr>
        <tr class="alt-color api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.OnInitializedListener.html">YouTubePlayer.OnInitializedListener</a></td>
              <td class="jd-descrcol" width="100%">Interface definition for callbacks which are invoked when player initialization succeeds or
 fails.&nbsp;</td>
          </tr>
        <tr class=" api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.PlaybackEventListener.html">YouTubePlayer.PlaybackEventListener</a></td>
              <td class="jd-descrcol" width="100%">Interface definition for callbacks  which are invoked when video playback events occur.&nbsp;</td>
          </tr>
        <tr class="alt-color api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.PlayerStateChangeListener.html">YouTubePlayer.PlayerStateChangeListener</a></td>
              <td class="jd-descrcol" width="100%">Interface definition for callbacks which are invoked when the high level player state changes.&nbsp;</td>
          </tr>
        <tr class=" api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.PlaylistEventListener.html">YouTubePlayer.PlaylistEventListener</a></td>
              <td class="jd-descrcol" width="100%">Interface definition for callbacks which are invoked when events related to playlists occur.&nbsp;</td>
          </tr>
        <tr class="alt-color api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.Provider.html">YouTubePlayer.Provider</a></td>
              <td class="jd-descrcol" width="100%">A class which implements this interface can provide a <code><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.html">YouTubePlayer</a></code> instance.&nbsp;</td>
          </tr>
        <tr class=" api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubeThumbnailLoader.html">YouTubeThumbnailLoader</a></td>
              <td class="jd-descrcol" width="100%">A YouTubeThumnailLoader provides methods for loading YouTube thumbnails into a
 <code><a href="../../../../../com/google/android/youtube/player/YouTubeThumbnailView.html">YouTubeThumbnailView</a></code>.&nbsp;</td>
          </tr>
        <tr class="alt-color api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubeThumbnailLoader.OnThumbnailLoadedListener.html">YouTubeThumbnailLoader.OnThumbnailLoadedListener</a></td>
              <td class="jd-descrcol" width="100%">Interface definition for a listener that is invoked when a thumbnail has been loaded.&nbsp;</td>
          </tr>
        <tr class=" api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubeThumbnailView.OnInitializedListener.html">YouTubeThumbnailView.OnInitializedListener</a></td>
              <td class="jd-descrcol" width="100%">An interface with definitions of callbacks invoked when thumbnail view initialization succeeds
 or fails.&nbsp;</td>
          </tr>
  </table>
    </div>
  


  
    <h2>Classes</h2>
    <div class="jd-sumtable">
    
  <table class="jd-sumtable-expando">
        <tr class="alt-color api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubeApiServiceUtil.html">YouTubeApiServiceUtil</a></td>
              <td class="jd-descrcol" width="100%">Utility class for verifying that the YouTube Player API service is available and up-to-date on
 this device.&nbsp;</td>
          </tr>
        <tr class=" api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubeBaseActivity.html">YouTubeBaseActivity</a></td>
              <td class="jd-descrcol" width="100%">Any activity that wants to directly incorporate <code><a href="../../../../../com/google/android/youtube/player/YouTubePlayerView.html">YouTubePlayerView</a></code> views in their UI
 must extend this activity.&nbsp;</td>
          </tr>
        <tr class="alt-color api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubeIntents.html">YouTubeIntents</a></td>
              <td class="jd-descrcol" width="100%">A selection of static methods that create intents which navigate to specific activities within
 the main YouTube application.&nbsp;</td>
          </tr>
        <tr class=" api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubePlayerFragment.html">YouTubePlayerFragment</a></td>
              <td class="jd-descrcol" width="100%">A fragment which contains a <code><a href="../../../../../com/google/android/youtube/player/YouTubePlayerView.html">YouTubePlayerView</a></code>.&nbsp;</td>
          </tr>
        <tr class="alt-color api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubePlayerSupportFragment.html">YouTubePlayerSupportFragment</a></td>
              <td class="jd-descrcol" width="100%">The support fragment version of <code><a href="../../../../../com/google/android/youtube/player/YouTubePlayerFragment.html">YouTubePlayerFragment</a></code>.&nbsp;</td>
          </tr>
        <tr class=" api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubePlayerView.html">YouTubePlayerView</a></td>
              <td class="jd-descrcol" width="100%">A view for displaying YouTube videos.&nbsp;</td>
          </tr>
        <tr class="alt-color api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubeStandalonePlayer.html">YouTubeStandalonePlayer</a></td>
              <td class="jd-descrcol" width="100%">This class creates intents that will play YouTube videos in a standalone player activity.&nbsp;</td>
          </tr>
        <tr class=" api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubeThumbnailView.html">YouTubeThumbnailView</a></td>
              <td class="jd-descrcol" width="100%">A view which can be used to display YouTube thumbnails, either for a specific YouTube video or a
 YouTube playlist.&nbsp;</td>
          </tr>
  </table>
    </div>
  


  
    <h2>Enums</h2>
    <div class="jd-sumtable">
    
  <table class="jd-sumtable-expando">
        <tr class="alt-color api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubeInitializationResult.html">YouTubeInitializationResult</a></td>
              <td class="jd-descrcol" width="100%">Provides the result of initializating the YouTube API Service.&nbsp;</td>
          </tr>
        <tr class=" api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.ErrorReason.html">YouTubePlayer.ErrorReason</a></td>
              <td class="jd-descrcol" width="100%">Describes the reason for an error in a <code><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.html">YouTubePlayer</a></code>.&nbsp;</td>
          </tr>
        <tr class="alt-color api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubePlayer.PlayerStyle.html">YouTubePlayer.PlayerStyle</a></td>
              <td class="jd-descrcol" width="100%">The different styles available for the player.&nbsp;</td>
          </tr>
        <tr class=" api apilevel-" >
              <td class="jd-linkcol"><a href="../../../../../com/google/android/youtube/player/YouTubeThumbnailLoader.ErrorReason.html">YouTubeThumbnailLoader.ErrorReason</a></td>
              <td class="jd-descrcol" width="100%">Describes the reasons for an error in a <code><a href="../../../../../com/google/android/youtube/player/YouTubeThumbnailView.html">YouTubeThumbnailView</a></code>.&nbsp;</td>
          </tr>
  </table>
    </div>
  


  


  


<div id="footer" class="wrap" >
        

  <div id="copyright">
    
  Except as noted, this content is licensed under <a
  href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a>. 
  For details and restrictions, see the <a href="http://developer.android.com/license.html">
  Content License</a>.
  </div>


  <div id="footerlinks">
    
  <p>
    <a href="http://developer.android.com/about/index.html">About Android</a>&nbsp;&nbsp;|&nbsp;
    <a href="http://developer.android.com/legal.html">Legal</a>&nbsp;&nbsp;|&nbsp;
    <a href="http://developer.android.com/support.html">Support</a>
  </p>
  </div>

</div> <!-- end footer -->

</div><!-- end jd-content -->
</div><!-- doc-content -->

</div> <!-- end body-content --> 




<!-- Grid - for dev 
<script type="text/javascript">

window.gOverride = {
		gColor: '#FF0000',
		pColor: '#EEEEEE',
		gOpacity: 0.10,
		pOpacity: 0.40,
		pHeight: 16,
		pOffset: 2,
		gColumns:16,
		gEnabled:false,
		pEnabled:false
	}
</script>
	
<link href="../../../../../assets/js/grid/960.gridder.css" rel="stylesheet" type="text/css">
<script src="../../../../../assets/js/grid/960.gridder.js" type="text/javascript"></script>
-->







</body>
</html>
